import request from '@/utils/request'

// 查询用车耗材明细列表
export function listMaterial (query) {
  return request({
    url: '/vehicle/material/list',
    method: 'get',
    params: query
  })
}

// 查询用车耗材明细详细
export function getMaterial (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/vehicle/material/getInfo',
    method: 'get',
    params: params
  })
}

// 新增用车耗材明细
export function addMaterial (data) {
  return request({
    url: '/vehicle/material/insert',
    method: 'post',
    data: data
  })
}

// 修改用车耗材明细
export function updateMaterial (data) {
  return request({
    url: '/vehicle/material/update',
    method: 'post',
    data: data
  })
}

// 删除用车耗材明细
export function delMaterial (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/vehicle/material/delete',
    method: 'post',
    params: params
  })
}
// 批量删除用车耗材明细
export function delBatchMaterial (ids) {
  const params = {
    'ids': ids
  }
  return request({
    url: '/vehicle/material/deleteBatch',
    method: 'post',
    params: params
  })
}

// 导入用车耗材明细
export function importData (data) {
  return request({
    url: '/vehicle/material/importData',
    method: 'post',
    data: data
  })
}
